home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Amiga_Mail_Vol2 / Archives / Plain / ja91 / ASCII / NFS / NFS.txt
Encoding:
Text File  |  1991-08-09  |  11.6 KB  |  389 lines

  1. (c)  Copyright 1991 Commodore-Amiga, Inc.   All rights reserved.
  2. The information contained herein is subject to change without notice,
  3. and is provided "as is" without warranty of any kind, either expressed
  4. or implied.  The entire risk as to the use of this information is
  5. assumed by the user.
  6.  
  7.  
  8. Using the Amiga A3000UX as a NFS File Server
  9.  
  10. By David Miller - Unix Technical Support Specialist, CATS
  11.  
  12.  
  13.  
  14. You've just added an A3000UX to your ethernet and you can rcp and ftp files
  15. between UNIX and AmigaDOS using the AS225 TCP/IP software.  Great!  But what
  16. about the AS225's Network File System (NFS) client software?  Under AmigaDOS,
  17. the NFS software lets your Amiga mount the drives of a NFS server as normal
  18. DOS volumes, but how do you set up a server?
  19.  
  20. NFS allows one machine to share files with other machines connected to a
  21. network.  NFS lets multiple machines access the same files, so only one copy
  22. of the data is necessary.  A client machine (a client is any machine that can
  23. mount a shared directory) can free some of its disk space by moving common
  24. programs to the server's disk (a server is any machine that shares a part of
  25. its disk with other machines).
  26.  
  27. There are however limitations when sharing files between machines with
  28. different operating systems.  For example;
  29.  
  30. o  Filenames - UNIX S5 filesystem does not support filenames longer than 14
  31.      characters.  If you copy files from AmigaDOS to UNIX, make sure that they are
  32.      unique in the first 14 characters.  And don't forget about the ".info" files!
  33.      If you copy a file that has a ".info" file associated with it, be sure that
  34.      the name preceding the ".info" does not exceed 9 characters.
  35. o  Permissions - UNIX files have permissions for read, write, and execute.
  36.      There is no delete permission; if you have write access to the directory, you
  37.      can delete any file it contains.  Script and archive bits are not supported
  38.      either, so setting the script or archive bits, or clearing the delete bit
  39.      will not work.
  40. o  Filenotes - UNIX does not support filenotes.  If you copy a file from an
  41.      AmigaDOS filesystem to a UNIX filesystem, any file notes will be lost.
  42.      Likewise, you cannot add a comment to a file on a UNIX filesystem.  You will
  43.      not receive any error indication, but the operation will have no effect.
  44.  
  45. The following notes will walk you step-by-step through the process of
  46. configuring and administering NFS on the A3000UX.  If you have used NFS
  47. before with BSD, Sun/OS, Ultrix, or any other operating system, you should at
  48. least skim over these notes, because the implementation is different under
  49. UNIX SVR4.
  50.  
  51. To keep this article brief, I'm making the following assumptions:
  52.  
  53.         o  You know how to use one of the editors shipped with Amiga UNIX.
  54.         o  You know how to log in as root or how to su to root.
  55.  
  56. If you don't, read the Learning Amiga UNIX and Using Amiga UNIX manuals which
  57. come with the  A3000UX.
  58.  
  59. The five examples illustrate how to do some simple file sharing with NFS.
  60. Using the concepts discussed in these examples you will be able to select the
  61. options necessary to share files while maintaining system security and
  62. integrity.  But, first, you need to start the networking software on the
  63. A3000UX, if it's not already running.  To do this, type the following:
  64.  
  65.     # init 3
  66.  
  67. This changes the operating to ``run-level'' 3, the networking run-level.
  68. Other run-levels include:
  69.  
  70.       S - single user maintenance mode
  71.       0 - system power off
  72.       1 - single user mode
  73.       2 - multiuser mode w/o networking
  74.       3 - multiuser mode w/ networking
  75.       4 - user defined
  76.       5 - system reboot
  77.       6 - system reboot
  78.  
  79. To find out what your machine's current run-level is, type:
  80.  
  81.     # who -r
  82.  
  83. The output will look something like this:
  84.  
  85.         run-level 3  Jun 18 18:40    3    0    S
  86.  
  87. Here's what all of that means:
  88.  
  89.              run-level 3  Jun 18 18:40    3    0    S
  90.  
  91.  
  92. This is the
  93. current state
  94. of your machine
  95.  
  96. This is when the current
  97. run-level was entered
  98.  
  99. This is the current run-level
  100.  
  101. This is the number of times
  102. your machine has been in this
  103. run-level before.
  104.  
  105. This is the previous run-level
  106.  
  107.  
  108. This is the host table (/etc/inet/hosts on Amiga UNIX and INET:db/hosts on
  109. AmigaDOS) that I'll be using for the examples:
  110.  
  111. #
  112. #       TCP/IP HOST TABLE
  113. #
  114. #
  115. 127.0.0.1       localhost loghost loopback me
  116. #
  117. #
  118. #       Widget works engineering network
  119. #
  120. #
  121. # IP Number     Name            Nickname        Comment
  122. #
  123. 192.9.120.1      Hydrogen         H             # A3000UX - in comp center
  124. 192.9.120.2      Helium           He            # A2000   - in room 316
  125. 192.9.120.3      Lithium          Li            # A2500   - in room 321
  126. 192.9.120.4      Beryllium        Be            # A3000   - in room 320
  127. 192.9.120.5      Boron            B             # A2500   - in room 119
  128. 192.9.120.6      Carbon           C             # A2000   - in room 119
  129. 192.9.120.7      Nitrogen         N             # A2000   - in room 204
  130. 192.9.120.8      Oxygen           O             # A3000   - in room 220
  131. 192.9.120.9      Fluorine         F             # A2500   - in room 132
  132. 192.9.120.10     Neon             Ne            # A3000   - in room 307
  133.  
  134.  
  135. The host table contains a list of IP addresses with node names for each of
  136. those addresses.  The machine uses this list to find other nodes by their
  137. name, rather than their numeric IP address.
  138.  
  139.  
  140. Example 1
  141.  
  142. Hydrogen has a directory called /home/scratch which is for temporary storage.
  143. Everyone should be able to read and write in this directory.  To share this
  144. with the rest of the net, the administrator of Hydrogen would type:
  145.  
  146.         share -F nfs -o rw /home/scratch
  147.  
  148. where:
  149.  
  150. share           is the command to share files between hosts.
  151. -F nfs          tells the program share to use the NFS filesystem.
  152. -o rw           tells the program share to allow all systems both read and
  153.                   write access to the shared files.  This is the default if you
  154.                   don't supply any options.  I've just included it here for
  155.                   completeness.
  156. /home/scratch   is the directory to be shared.
  157.  
  158.  
  159. Example 2
  160.  
  161. Hydrogen also has a large disk attached as /storage.  To allow other hosts to
  162. use this as extra disk space type the following:
  163.  
  164.         share -F nfs -o rw=Helium /storage/Helium
  165.         share -F nfs -o rw=Lithium /storage/Lithium
  166.                 ...
  167.         share -F nfs -o rw=Ne /storage/Neon
  168.  
  169. where:
  170.  
  171.         -o rw=name  tells share to allow <name> to mount this resource and to
  172.                                       deny access to everyone else.
  173.  
  174.  
  175. This establishes private storage areas for each host.  This way all of the
  176. hosts can share the disk without having their files readable by everyone on
  177. the network.
  178.  
  179. Note the use of the nickname Ne for the host Neon.  Nicknames must be
  180. explicitly entered in the host table and may be used interchangeably with the
  181. full name of the host.
  182.  
  183.  
  184.  
  185.  
  186. Example 3
  187.  
  188. A group of hosts on the first floor of your building are all being used on
  189. one big project, so they need a common work area to store files.  The
  190. administrator could create a work area in /storage called, for example,
  191. ff-project, for first-floor-project, then give the hosts on the first floor
  192. access to this work area by typing:
  193.  
  194.         share -F nfs -o rw=Boron:Carbon:Fluorine /storage/ff-project
  195.  
  196. where:
  197.  
  198.         -o rw=name[:name]...
  199.  
  200. allows read and write access to the hosts that are listed and denies access
  201. to everyone else and
  202.  
  203.         /storage/ff-project
  204.  
  205. is the name of the directory to share.
  206.  
  207.  
  208. Example 4
  209.  
  210. Hydrogen has a directory called /home/public which is full of useful Amiga
  211. tools.  To share these with the rest of the net, the administrator of
  212. Hydrogen would type:
  213.  
  214.         share -F nfs -o ro /home/public
  215.  
  216. where:
  217.  
  218.         -o ro
  219.  
  220. tells share to make the shared filesystem readable to all hosts and writable
  221. by no one.  The ``ro'' stands for ``read-only'' and
  222.  
  223.         /home/public
  224.  
  225. is the name of the directory to share.
  226.  
  227.  
  228. The files are shared read-only for two reasons.  The first is that it
  229. prevents temporary files from being created in the shared partition.  Also it
  230. prevents accidental or malicious removal of shared files.
  231.  
  232.  
  233. Example 5
  234.  
  235. Now, coincidentally, Hydrogen also has a directory called /home/private which
  236. is full of special tools used only by the development staff on the 3rd floor.
  237. To share these exclusively with the hosts on the third floor, the
  238. administrator of Hydrogen would type:
  239.  
  240.         share -F nfs -o ro=He:Li:Be:Ne /home/private
  241.  
  242. where:
  243.  
  244.         -o ro=name[:name]...
  245.  
  246. tells the share program to give the listed hosts read access to the shared
  247. files.  All other hosts will be denied access to the shared files (Note the
  248. use of nicknames) and
  249.  
  250.         /home/private
  251.  
  252. is the name of the shared filesystem.
  253.  
  254. These options may be combined to allow different types of access.  For
  255. example:
  256.  
  257.         -o rw=Helium:Neon,ro
  258.  
  259. Everyone can read shared files, but only Helium and Neon have write access.
  260.  
  261.  
  262.         -o rw,ro=Fluorine
  263.  
  264. Everyone except Fluorine may read and write files.  Fluorine may only read
  265. files.
  266.  
  267.         -o rw=C:O,ro=N
  268.  
  269. Carbon and Oxygen have read and write access, Nitrogen has read access, and
  270. the others have no access.
  271.  
  272. To summarize:
  273.  
  274.         -o ro           Gives everyone read-only access to the shared files
  275.         -o rw           Gives everyone read/write access
  276.         -o ro=...       Gives read-only access to the listed hosts
  277.         -o rw=...       Gives read/write access to the listed hosts
  278.  
  279.  
  280. If a host appears in both a rw= and a ro= list, the host will be given read
  281. and write access.  The ordering of the options does not matter.
  282.  
  283. Since you probably want these directories to be shared automatically every
  284. time you start Amiga UNIX, you need to perform the following steps:
  285.  
  286.  
  287. 1.      Edit the file /etc/inittab and change the line:
  288.  
  289. is:2:initdefault
  290.  
  291.     to
  292.  
  293. is:3:initdefault
  294.  
  295. This will make your machine go directly to run-level 3 when you boot the UNIX
  296. Operating System.
  297.  
  298.  
  299. 2.      Edit the file /etc/dfs/dfstab, and enter one line for each directory
  300.           to be shared.  For Example 1 above, this would be the line:
  301.  
  302.         share -F nfs -o ro /home/public
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309. So, the complete dfstab for the 5 examples given above would look something
  310. like this:
  311.  
  312.  
  313. #
  314. # For Example 1
  315. #
  316. share -F nfs -o rw /home/scratch
  317.  
  318. #
  319. # For Example 2
  320. #
  321. share -F nfs -o rw=Hydrogen /storage/Hydrogen
  322. share -F nfs -o rw=Helium /storage/Helium
  323. share -F nfs -o rw=Lithium /storage/Lithium
  324. share -F nfs -o rw=Beryllium /storage/Beryllium
  325. share -F nfs -o rw=Boron /storage/Boron
  326. share -F nfs -o rw=Carbon /storage/Carbon
  327. share -F nfs -o rw=Nitrogen /storage/Nitrogen
  328. share -F nfs -o rw=Oxygen /storage/Oxygen
  329. share -F nfs -o rw=Fluorine /storage/Fluorine
  330. share -F nfs -o rw=Neon /storage/Neon
  331.  
  332. #
  333. # For Example 3
  334. #
  335. share -F nfs -o rw=Boron:Carbon:Fluorine /storage/ff-project
  336.  
  337. #
  338. # For Example 4
  339. #
  340. share -F nfs -o ro /home/public
  341.  
  342. #
  343. # For Example 5
  344. #
  345. share -F nfs -o ro=He:Li:Be:Ne /home/private
  346.  
  347.  
  348.  
  349. 3.      Run the command:
  350.  
  351.         shareall -F nfs
  352.  
  353. which will share all of the NFS filesystems, and the command:
  354.  
  355.         unshareall -F nfs
  356.  
  357. which will make the NFS filesystems unavailable.
  358.  
  359.  
  360. For those interested in more information on UNIX SVR4 networking, either as a
  361. user or an administrator, UNIX System V Release 4 - Network User's and
  362. Administrator's Guide, published by Prentice Hall is an excellent starting
  363. place.
  364.  
  365. If you have any suggestions for the new Amiga UNIX section of Amiga Mail,
  366. please send it to me either via email:
  367.  
  368.         davidm@cbmvax.commodore.com
  369.                 or
  370.         ...!{rutgers,uunet}!cbmvax!davidm
  371.  
  372. or US Mail:
  373.  
  374.         ATTN:  David Miller
  375.         Commodore Applications and Technical Support
  376.         Commodore Business Machines, Inc.
  377.         1200 Wilson Drive
  378.         West Chester, PA 19380
  379.  
  380. or FAX:
  381.  
  382.         David Miller
  383.         Commodore Business Machines
  384.         +1 215 431 9156
  385.  
  386. or BIX:
  387.         david.miller
  388.  
  389. v